package com.example.springblog.mapper;

import com.example.springblog.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserInfoMapper {
    //根据用户名查询用户的信息
    @Select("select id,user_name,password,github_url from user where user_name = #{name} and delete_flag = 0")
    UserInfo selectByName(String name);

    //根据用户的id查询用户的信息
    @Select("select id,user_name,password,github_url from user where id = #{id} and delete_flag = 0")
    UserInfo selectById(Integer id);
}
